Optimal. Leaf size=335 \[ -\frac {2 B g^2 (b c-a d)^3 \log \left (1-\frac {d (a+b x)}{b (c+d x)}\right ) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{3 b d^3}-\frac {2 B g^2 (c+d x) (b c-a d)^2 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{3 d^3}+\frac {B g^2 (a+b x)^2 (b c-a d) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{3 b d}+\frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2}{3 b}+\frac {2 B^2 g^2 (b c-a d)^3 \text {Li}_2\left (\frac {d (a+b x)}{b (c+d x)}\right )}{3 b d^3}-\frac {B^2 g^2 (b c-a d)^3 \log (a+b x)}{b d^3}-\frac {B^2 g^2 (b c-a d)^3 \log \left (\frac {c+d x}{a+b x}\right )}{3 b d^3}+\frac {B^2 g^2 x (b c-a d)^2}{3 d^2} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.56, antiderivative size = 389, normalized size of antiderivative = 1.16, number of steps used = 20, number of rules used = 13, integrand size = 32, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.406, Rules used = {2525, 12, 2528, 2486, 31, 43, 2524, 2418, 2394, 2393, 2391, 2390, 2301} \[ \frac {2 B^2 g^2 (b c-a d)^3 \text {PolyLog}\left (2,\frac {b (c+d x)}{b c-a d}\right )}{3 b d^3}+\frac {2 B g^2 (b c-a d)^3 \log (c+d x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{3 b d^3}-\frac {2 A B g^2 x (b c-a d)^2}{3 d^2}+\frac {B g^2 (a+b x)^2 (b c-a d) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )}{3 b d}+\frac {g^2 (a+b x)^3 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2}{3 b}-\frac {2 B^2 g^2 (a+b x) (b c-a d)^2 \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B^2 g^2 x (b c-a d)^2}{3 d^2}-\frac {B^2 g^2 (b c-a d)^3 \log ^2(c+d x)}{3 b d^3}-\frac {B^2 g^2 (b c-a d)^3 \log (c+d x)}{b d^3}+\frac {2 B^2 g^2 (b c-a d)^3 \log (c+d x) \log \left (-\frac {d (a+b x)}{b c-a d}\right )}{3 b d^3} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 12
Rule 31
Rule 43
Rule 2301
Rule 2390
Rule 2391
Rule 2393
Rule 2394
Rule 2418
Rule 2486
Rule 2524
Rule 2525
Rule 2528
Rubi steps
\begin {align*} \int (a g+b g x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2 \, dx &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {(2 B) \int \frac {(b c-a d) g^3 (a+b x)^2 \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{c+d x} \, dx}{3 b g}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (2 B (b c-a d) g^2\right ) \int \frac {(a+b x)^2 \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{c+d x} \, dx}{3 b}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (2 B (b c-a d) g^2\right ) \int \left (-\frac {b (b c-a d) \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{d^2}+\frac {b (a+b x) \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{d}+\frac {(-b c+a d)^2 \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{d^2 (c+d x)}\right ) \, dx}{3 b}\\ &=\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (2 B (b c-a d) g^2\right ) \int (a+b x) \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx}{3 d}+\frac {\left (2 B (b c-a d)^2 g^2\right ) \int \left (-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )\right ) \, dx}{3 d^2}-\frac {\left (2 B (b c-a d)^3 g^2\right ) \int \frac {-A-B \log \left (\frac {e (c+d x)}{a+b x}\right )}{c+d x} \, dx}{3 b d^2}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (B^2 (b c-a d) g^2\right ) \int \frac {(b c-a d) (-a-b x)}{c+d x} \, dx}{3 b d}-\frac {\left (2 B^2 (b c-a d)^2 g^2\right ) \int \log \left (\frac {e (c+d x)}{a+b x}\right ) \, dx}{3 d^2}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (c+d x)}{e (c+d x)} \, dx}{3 b d^3}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (B^2 (b c-a d)^2 g^2\right ) \int \frac {-a-b x}{c+d x} \, dx}{3 b d}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {1}{c+d x} \, dx}{3 b d^2}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {(a+b x) \left (\frac {d e}{a+b x}-\frac {b e (c+d x)}{(a+b x)^2}\right ) \log (c+d x)}{c+d x} \, dx}{3 b d^3 e}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}-\frac {2 B^2 (b c-a d)^3 g^2 \log (c+d x)}{3 b d^3}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (B^2 (b c-a d)^2 g^2\right ) \int \left (-\frac {b}{d}+\frac {b c-a d}{d (c+d x)}\right ) \, dx}{3 b d}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \left (-\frac {b e \log (c+d x)}{a+b x}+\frac {d e \log (c+d x)}{c+d x}\right ) \, dx}{3 b d^3 e}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B^2 (b c-a d)^2 g^2 x}{3 d^2}-\frac {B^2 (b c-a d)^3 g^2 \log (c+d x)}{b d^3}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}+\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {\log (c+d x)}{a+b x} \, dx}{3 d^3}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {\log (c+d x)}{c+d x} \, dx}{3 b d^2}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B^2 (b c-a d)^2 g^2 x}{3 d^2}-\frac {B^2 (b c-a d)^3 g^2 \log (c+d x)}{b d^3}+\frac {2 B^2 (b c-a d)^3 g^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{3 b d^3}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \operatorname {Subst}\left (\int \frac {\log (x)}{x} \, dx,x,c+d x\right )}{3 b d^3}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \int \frac {\log \left (\frac {d (a+b x)}{-b c+a d}\right )}{c+d x} \, dx}{3 b d^2}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B^2 (b c-a d)^2 g^2 x}{3 d^2}-\frac {B^2 (b c-a d)^3 g^2 \log (c+d x)}{b d^3}+\frac {2 B^2 (b c-a d)^3 g^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{3 b d^3}-\frac {B^2 (b c-a d)^3 g^2 \log ^2(c+d x)}{3 b d^3}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}-\frac {\left (2 B^2 (b c-a d)^3 g^2\right ) \operatorname {Subst}\left (\int \frac {\log \left (1+\frac {b x}{-b c+a d}\right )}{x} \, dx,x,c+d x\right )}{3 b d^3}\\ &=-\frac {2 A B (b c-a d)^2 g^2 x}{3 d^2}+\frac {B^2 (b c-a d)^2 g^2 x}{3 d^2}-\frac {B^2 (b c-a d)^3 g^2 \log (c+d x)}{b d^3}+\frac {2 B^2 (b c-a d)^3 g^2 \log \left (-\frac {d (a+b x)}{b c-a d}\right ) \log (c+d x)}{3 b d^3}-\frac {B^2 (b c-a d)^3 g^2 \log ^2(c+d x)}{3 b d^3}-\frac {2 B^2 (b c-a d)^2 g^2 (a+b x) \log \left (\frac {e (c+d x)}{a+b x}\right )}{3 b d^2}+\frac {B (b c-a d) g^2 (a+b x)^2 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d}+\frac {2 B (b c-a d)^3 g^2 \log (c+d x) \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )}{3 b d^3}+\frac {g^2 (a+b x)^3 \left (A+B \log \left (\frac {e (c+d x)}{a+b x}\right )\right )^2}{3 b}+\frac {2 B^2 (b c-a d)^3 g^2 \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )}{3 b d^3}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A] time = 0.24, size = 290, normalized size = 0.87 \[ \frac {g^2 \left ((a+b x)^3 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )^2-\frac {B (b c-a d) \left (-d^2 (a+b x)^2 \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )-2 (b c-a d)^2 \log (c+d x) \left (B \log \left (\frac {e (c+d x)}{a+b x}\right )+A\right )+2 A b d x (b c-a d)+2 b B (c+d x) (b c-a d) \log \left (\frac {e (c+d x)}{a+b x}\right )-B (b c-a d)^2 \left (2 \text {Li}_2\left (\frac {b (c+d x)}{b c-a d}\right )+\log (c+d x) \left (2 \log \left (\frac {d (a+b x)}{a d-b c}\right )-\log (c+d x)\right )\right )+2 B (b c-a d)^2 \log (a+b x)-B (b c-a d) ((a d-b c) \log (c+d x)+b d x)\right )}{d^3}\right )}{3 b} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
fricas [F] time = 1.02, size = 0, normalized size = 0.00 \[ {\rm integral}\left (A^{2} b^{2} g^{2} x^{2} + 2 \, A^{2} a b g^{2} x + A^{2} a^{2} g^{2} + {\left (B^{2} b^{2} g^{2} x^{2} + 2 \, B^{2} a b g^{2} x + B^{2} a^{2} g^{2}\right )} \log \left (\frac {d e x + c e}{b x + a}\right )^{2} + 2 \, {\left (A B b^{2} g^{2} x^{2} + 2 \, A B a b g^{2} x + A B a^{2} g^{2}\right )} \log \left (\frac {d e x + c e}{b x + a}\right ), x\right ) \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [F] time = 1.81, size = 0, normalized size = 0.00 \[ \int \left (b g x +a g \right )^{2} \left (B \ln \left (\frac {\left (d x +c \right ) e}{b x +a}\right )+A \right )^{2}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 2.09, size = 1172, normalized size = 3.50 \[ \text {result too large to display} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.00 \[ \int {\left (a\,g+b\,g\,x\right )}^2\,{\left (A+B\,\ln \left (\frac {e\,\left (c+d\,x\right )}{a+b\,x}\right )\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F(-1)] time = 0.00, size = 0, normalized size = 0.00 \[ \text {Timed out} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________